<template>
  <div class="container">
    <div>{{name}}</div>
    <div>{{age}}</div>
    <button @click="updatename()">修改数据</button>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'App',
  setup () {
    const name = ref('ls')
    console.log(name);
    const age = ref(15)

    const updatename = () => {
      name.value = 'ww'
    }

    // 讲义：伪代码，数据未知的情况下，复杂数据类型reactive
    // const data = ref(null)
    // setTimeout(() => {
    // 	data.value = res.data
    // })

    return { name, age, updatename }
  }
}
</script>

<style>
</style>